1. Field of the Invention
The present invention relates generally to a document image processing apparatus and a document image processing method for correcting a line portion manually input to a document including characters for display, and a computer readable recording medium recorded with a document image processing program therefor. The present invention more particularly relates to a document image processing apparatus and a document image processing method for correcting a manually input line portion at a desired position based the manner in which the line portion has been manually input, and a computer readable recording medium recorded with a document image processing program therefor.
2. Description of the Background Art
Japanese Patent Laying-Open No. 61-273070 discloses an image processing apparatus having an editing function of underlining a desired part of a read document image. The image processing apparatus has a display portion to display the read document image. When the user wants to underline a desired character string in a displayed document image, he/she designates the desired character string using a mouse device or the like and inputs a prepared editing command to xe2x80x9cunderlinexe2x80x9d. As a result, the desired character string will be underlined. This kind of image processing apparatus is however poor in the operability because the user must input a command for editing while designating the region of a character string to be underlined on a string basis.
Japanese Patent Laying-Open No. 8-30250 discloses a document processing apparatus which underlines the image of a character string developed into a dot image. When the entire line of strings of characters whose sizes and kinds vary is underlined by the document processing apparatus, information related to rectangular regions surrounding the characters in the strings and a rectangular region surrounding all the character strings is used to place an underline at a desired position apart from the rectangular region surrounding all the character strings by an arbitrary distance. By the document processing apparatus, a line of character strings is underlined Therefore, only a particular character or a designated particular string of characters in an image including a plurality of lines of character strings cannot be underlined, which is not suitable for general-purpose use.
Japanese Patent Laying-Open No. 5-181857 discloses an information processing apparatus which allows the user to easily input and display modification information such as underlining for characters. In this information processing apparatus however only text data can be edited, and modification information for images cannot be input. Furthermore, an input region should be specifically provided for modification information for characters, which is disadvantageous.
The operation of manually drawing a line along a character string in a displayed document image is similar to the operation of drawing a line under a character string printed on a paper sheet, which has a high performance man machine interface. In the conventional manner of manual input, however, a manually input line portion is displayed as is, and therefore a line portion drawn over a character string by mistake is displayed as crossing the character string and the result sometimes turns out to be hard to read. A manually input, would-be straight line could be displayed as an awkward line which is not exactly straight. When different kinds of lines are input manually, an aiding tool such as scale is necessary, which is also disadvantageous in terms of the operability.
One object of the present invention is to provide an apparatus and a method for processing document images, which permits the user to manually draw a smooth line portion along an arbitrary character string in a document image with high operability, and a computer-readable recording medium recorded with a document image processing program therefor.
In order to achieve the above-described object of the invention, a document image processing apparatus according to one aspect of the present invention has the following construction. The document image processing apparatus includes a display portion to display document images, a line input portion to input a line portion manually drawn along an arbitrary character string in a document image displayed at the display portion, and a processing portion to process the input line portion. The processing portion has a direction determining portion to determine the direction of the manually drawn line portion, a row extracting portion and a line correcting portion. The row extracting portion extracts the region of a row including an arbitrary character string in the region of a document image based on a direction determined by the direction determining portion and one or more character images in the document image. The line correcting portion corrects a manually drawn line portion into a normal line portion drawn along the region of the row extracted by the row extracting portion for display at the display portion.
Therefore, by simply manually drawing a line portion through the line input portion to the image of an arbitrary character string of interest in the document image, a normal line portion can be drawn along the image of the arbitrary character string by the line correcting portion. As a result, by simply manually drawing a line portion to an arbitrary character string as desired, the user can place a good line portion along the arbitrary character string, in other words, the user may obtain a refined document image.
The processing portion in the above-described document image processing apparatus may further include a processing region designating portion to designate a processing region for processing a manually drawn line portion in a document image region.
By thus providing the processing region designating portion, the user can be released from operations such as designating a processing region in a document image in advance, which improves the operability. Since only a designated processing region is processed rather than the entire region of the document image, the processing portion can operate accurately and at high speed.
The row extracting portion in the above image processing apparatus may have a candidate region extracting portion and a row region determining portion. The candidate region extracting portion extracts at least one candidate region for a row based on a direction determined by the direction determining portion and the direction of the region of at least one character image in the region of the document image. The row region determining portion determines the region of a row including an arbitrary character string in at least one candidate region extracted.
Therefore, if a plurality of regions are extracted by the candidate region extracting portion, the row region determining portion determines along which region among the plurality of candidate regions the manually drawn line portion has been placed. As a result, the user is released from operations such as designating the region of a row including an arbitrary character string along which a manually drawn line portion is placed, which improves the operability.
In the above-described document image processing apparatus, the normal line portion may be a straight line. Therefore, if an awkward line portion is manually drawn along an arbitrary character string, the manually drawn line portion can be corrected to a straight line portion for display.
In the above-described document image processing apparatus, the line correcting portion has a line kind recognizing portion to recognize the kind of a manually drawn line portion, and corrects the manually drawn line portion into a normal line portion based on the kind of line portion recognized.
Therefore, a manually drawn line portion can be corrected into a normal line portion based on the kind of the line portion (such as broken line and corrugated line), various kinds of line portions may be placed along an arbitrary character string in a fine style.
The line correcting portion in the above document image processing apparatus has an adjusting portion. The adjusting portion adjusts the length of a normal line portion into an optimum length based on the region of at least one character in the region of a row extracted by the row extracting portion.
As a result, using at least one character region in the region of an extracted row, in other words, based on the region of an arbitrary character string, the normal line portion can be adjusted to have an optimum length, so that a document image in a better style may be provided.
In the line correcting portion in the document image processing apparatus, a normal line position correcting portion is applied if one or more normal line portions have already been drawn along the region of a row extracted by the row extracting portion. The normal line position correcting portion corrects the position of a normal line portion corresponding to a manually drawn line portion such that the normal line portion is drawn continuously with those at least one line portions already drawn in the region of the corresponding row.
Therefore, if a normal line portion has already been drawn in the same row region including an arbitrary character string, a normal line portion corresponding to a newly input manually drawn line portion is corrected to be displayed connected to the already drawn normal line portion, a document image in a better style may be provided.
In the line correcting portion in the above-described document image processing apparatus, a manually drawn line position correcting portion is applied, if at least one manually drawn line portion is input to the region of a row extracted by the row extracting portion. The manually drawn line position correcting portion adjusts the position of normal line portions corresponding to those at least one manually drawn line portions and corrects them into a single, continuous normal line portion.
As a result, if a plurality of manually drawn line portions are input in the same row region, a plurality of normal line portions corresponding to these manually drawn line portions are corrected into a single continuous normal line for display, a document image in a better style may be provided.
In the above-described document image processing apparatus, the line correcting portion has a ruby row recognizing portion to identify that the region of a row extracted by the row extracting portion corresponds to a row of rubies (for giving the pronunciation ((in kana) of Chinese characters for example). If a region of a row is identified by the ruby row recognizing portion as corresponding to a row of rubies, a manually drawn line portion is corrected into a normal line portion to be placed along the row of rubies.
As a result, if an arbitrary character string corresponds to a row of rubies, a normal line portion can be drawn appropriately, so that a document image in a better style may be provided.
A method of processing a document image according to another aspect of the present invention includes the steps of displaying a document image, inputting a manually drawn line portion along the image of an arbitrary character string in a displayed document image, and processing an input manually drawn line portion. The processing step has the steps of determining the direction of a manually drawn line portion, extracting the region of a row including an arbitrary character string in the region of a document image based on a determined direction and the image of at least one character in the document image, and correcting a manually drawn line portion into a normal line portion to be drawn along the region of an extracted row for display.
Therefore, by simply drawing a line portion to the image of an arbitrary character string in a document image, the manually drawn line portion may be corrected into a normal line portion to be drawn along the image of the arbitrary character string, the line portion may be easily placed along the arbitrary character string and therefore a document image in a better style may be provided.
According to yet another aspect of the present invention, a computer-readable recording medium recorded with a document image program to allow a computer to execute the above-described document image processing method can be provided.
The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.